<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Dissasemble: src/common.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="Hopper_v3.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Dissasemble
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">This project receives as input a file.o and displays the assembly code for that object.</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('common_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">src/common.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="common_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> ============================================================================</span>
<a name="l00003"></a>00003 <span class="comment"> Name        : common.h</span>
<a name="l00004"></a>00004 <span class="comment"> Author      :</span>
<a name="l00005"></a>00005 <span class="comment"> Version     :</span>
<a name="l00006"></a>00006 <span class="comment"> Copyright   : Your copyright notice</span>
<a name="l00007"></a>00007 <span class="comment"> Description :</span>
<a name="l00008"></a>00008 <span class="comment"> ============================================================================</span>
<a name="l00009"></a>00009 <span class="comment"> */</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="preprocessor">#ifndef COMMOND_H_</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define COMMOND_H_</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a><a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944">00014</a> <span class="preprocessor">#define UINT8  unsigned char ///&lt; One byte</span>
<a name="l00015"></a><a class="code" href="common_8h.html#a69afa2e50b905f4eab1f2df8a3fd9f23">00015</a> <span class="preprocessor"></span><span class="preprocessor">#define UINT32 unsigned int ///&lt; One instruction</span>
<a name="l00016"></a><a class="code" href="common_8h.html#aac92c5ec332dafe0abb24688dad1b795">00016</a> <span class="preprocessor"></span><span class="preprocessor">#define INT32  int ///&lt; Stores 32 bits</span>
<a name="l00017"></a><a class="code" href="common_8h.html#a7e125472d65b57f10905accbed140b99">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define INT8    char///&lt; Stores 8 bits</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="common_8h.html#a35962d72640f5d7417802c89b4eb5688">00019</a> <span class="preprocessor">#define BYTE(x) (x*8) ///&lt; One byte</span>
<a name="l00020"></a><a class="code" href="common_8h.html#a4aa5e2926d1ef8bcce281e0eab30025a">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define BIT2BYTE(x) (x/8)+(x%8?1:0) ///&lt; One byte in binary</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a><a class="code" href="struct__addresing_and_type.html">00022</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__addresing_and_type.html" title="Stores the attributes that specifies the addressing method.">_addresingAndType</a>
<a name="l00024"></a>00024 {
<a name="l00025"></a><a class="code" href="struct__addresing_and_type.html#a675718a27aa9afcb2091cb80e6605667">00025</a>         <a class="code" href="common_8h.html#a7e125472d65b57f10905accbed140b99" title="Stores 8 bits.">INT8</a> <a class="code" href="struct__addresing_and_type.html#a675718a27aa9afcb2091cb80e6605667" title="Addressing Method.">a</a>[10]; 
<a name="l00026"></a><a class="code" href="struct__addresing_and_type.html#a862599f1889ae51550769f8605615625">00026</a>         <a class="code" href="common_8h.html#a7e125472d65b57f10905accbed140b99" title="Stores 8 bits.">INT8</a> <a class="code" href="struct__addresing_and_type.html#a862599f1889ae51550769f8605615625" title="Operand Type.">t</a>[10];     
<a name="l00027"></a><a class="code" href="struct__addresing_and_type.html#a4bb1e094015b86be5965a0fbd7374e2e">00027</a>         <a class="code" href="common_8h.html#a7e125472d65b57f10905accbed140b99" title="Stores 8 bits.">INT8</a> <a class="code" href="struct__addresing_and_type.html#a4bb1e094015b86be5965a0fbd7374e2e" title="Opcode Fields.">flds</a>[10]; 
<a name="l00028"></a>00028 } <a class="code" href="common_8h.html#ac9bde6cb5ff196ce2027a47a647b49da" title="Stores the attributes that specifies the addressing method.">ADDRESSING_TYPE</a>;
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="struct__prefix.html">00031</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__prefix.html" title="Structure attributes associated with a prefix.">_prefix</a>
<a name="l00033"></a>00033 {
<a name="l00034"></a><a class="code" href="struct__prefix.html#a537893029f1863ac865b24ec727c24b8">00034</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="struct__prefix.html#a537893029f1863ac865b24ec727c24b8">value</a>;
<a name="l00035"></a>00035 } <a class="code" href="common_8h.html#afdc67d28e3a783fcf6783d0a72ad54cb" title="Structure attributes associated with a prefix.">PREFIX</a>;
<a name="l00036"></a>00036 
<a name="l00037"></a><a class="code" href="union__opcode.html">00037</a> <span class="keyword">typedef</span> <span class="keyword">union </span><a class="code" href="union__opcode.html" title="Stores the attributes that an opcode have.">_opcode</a>
<a name="l00039"></a>00039 {
<a name="l00040"></a><a class="code" href="union__opcode.html#a537893029f1863ac865b24ec727c24b8">00040</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__opcode.html#a537893029f1863ac865b24ec727c24b8" title="Operation code value.">value</a>; 
<a name="l00041"></a>00041         <span class="keyword">struct</span>
<a name="l00042"></a>00042         {
<a name="l00043"></a><a class="code" href="union__opcode.html#a301ca4ffab46d5f6a4bc26a4cd0933d3">00043</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__opcode.html#a301ca4ffab46d5f6a4bc26a4cd0933d3" title="Operation code.">opcode</a> :6; 
<a name="l00044"></a><a class="code" href="union__opcode.html#aef7bd9bb1f716afb151a4b4206d468f3">00044</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__opcode.html#aef7bd9bb1f716afb151a4b4206d468f3" title="Attribute direction.">d</a> :1; 
<a name="l00045"></a><a class="code" href="union__opcode.html#a9da8823b3091ce20c3570720de682c6b">00045</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__opcode.html#a9da8823b3091ce20c3570720de682c6b" title="Attribute store.">s</a> :1; 
<a name="l00046"></a>00046         };
<a name="l00047"></a>00047 } <a class="code" href="common_8h.html#a290890ba522b65bd476d39f9e3eb2268" title="Stores the attributes that an opcode have.">OPCODE</a>;
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 
<a name="l00050"></a><a class="code" href="union__mod__reg.html">00050</a> <span class="keyword">typedef</span> <span class="keyword">union </span><a class="code" href="union__mod__reg.html" title="Stores ModReg record attributes you set the registers used as operands.">_mod_reg</a>
<a name="l00052"></a>00052 {
<a name="l00053"></a><a class="code" href="union__mod__reg.html#a537893029f1863ac865b24ec727c24b8">00053</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__mod__reg.html#a537893029f1863ac865b24ec727c24b8">value</a>;
<a name="l00054"></a>00054         <span class="keyword">struct</span>
<a name="l00055"></a>00055         {
<a name="l00056"></a><a class="code" href="union__mod__reg.html#ae8f9835d003dd5958d1fdf496ed1ac06">00056</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__mod__reg.html#ae8f9835d003dd5958d1fdf496ed1ac06">mod</a> :2;
<a name="l00057"></a><a class="code" href="union__mod__reg.html#a110b5552af2d9555ad3238844f9b26a2">00057</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__mod__reg.html#a110b5552af2d9555ad3238844f9b26a2">reg_opcode</a> :3;
<a name="l00058"></a><a class="code" href="union__mod__reg.html#a4a1a64b628601eed4a2bf13d517bcba3">00058</a>                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="union__mod__reg.html#a4a1a64b628601eed4a2bf13d517bcba3">rm</a> :3;
<a name="l00059"></a>00059         };
<a name="l00060"></a>00060 } <a class="code" href="common_8h.html#a52e00366c03f672b7fe916eec1f2003c" title="Stores ModReg record attributes you set the registers used as operands.">MOD_REG_RM</a>;
<a name="l00061"></a>00061 
<a name="l00062"></a><a class="code" href="common_8h.html#a22613dfae1a9dc932b6a4513895411c9">00062</a> <span class="preprocessor">#define NUM_OPP_SUPPORTED 2 ///&lt; supported number of operators</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span>
<a name="l00064"></a><a class="code" href="struct___machine_inst_format.html">00064</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct___machine_inst_format.html" title="Machine Instruction Format.">_MachineInstFormat</a>
<a name="l00066"></a>00066 {
<a name="l00067"></a><a class="code" href="struct___machine_inst_format.html#a6828a502ed446152add8bca7a42d0d09">00067</a>         <a class="code" href="common_8h.html#a7e125472d65b57f10905accbed140b99" title="Stores 8 bits.">INT8</a> <a class="code" href="struct___machine_inst_format.html#a6828a502ed446152add8bca7a42d0d09" title="mnemonic">mnemonic</a>[8]; 
<a name="l00068"></a>00068 
<a name="l00069"></a><a class="code" href="struct___machine_inst_format.html#a53e89f0766181e3cfb8ec3b314f437ef">00069</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#a53e89f0766181e3cfb8ec3b314f437ef" title="Prefix value.">isPrefix</a>; 
<a name="l00070"></a><a class="code" href="struct___machine_inst_format.html#a42f928fa90cd801945bf61b59cb49e92">00070</a>         <a class="code" href="struct__prefix.html" title="Structure attributes associated with a prefix.">PREFIX</a> <a class="code" href="struct___machine_inst_format.html#a42f928fa90cd801945bf61b59cb49e92">prefix</a>;
<a name="l00071"></a>00071 
<a name="l00072"></a><a class="code" href="struct___machine_inst_format.html#afb7ad97a332968900eaa5c855884032b">00072</a>         <a class="code" href="union__opcode.html" title="Stores the attributes that an opcode have.">OPCODE</a> <a class="code" href="struct___machine_inst_format.html#afb7ad97a332968900eaa5c855884032b" title="Operation Code.">opcode</a>; 
<a name="l00073"></a>00073 
<a name="l00074"></a><a class="code" href="struct___machine_inst_format.html#af2c2ded7b07967b789041120b1ab496e">00074</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#af2c2ded7b07967b789041120b1ab496e">regOpValid</a>[<a class="code" href="common_8h.html#a22613dfae1a9dc932b6a4513895411c9" title="supported number of operators">NUM_OPP_SUPPORTED</a>];
<a name="l00075"></a><a class="code" href="struct___machine_inst_format.html#ad584458f2e8f530ffd6b90449da4c915">00075</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#ad584458f2e8f530ffd6b90449da4c915">regOpp</a>[<a class="code" href="common_8h.html#a22613dfae1a9dc932b6a4513895411c9" title="supported number of operators">NUM_OPP_SUPPORTED</a>][5];
<a name="l00076"></a>00076 
<a name="l00077"></a><a class="code" href="struct___machine_inst_format.html#af2cf9d902e06474e4cbcf47c1cdc6bfc">00077</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#af2cf9d902e06474e4cbcf47c1cdc6bfc" title="If it is a ModReg register.">isModeReg</a>; 
<a name="l00078"></a><a class="code" href="struct___machine_inst_format.html#a20fd0a52f211511f01c63f5ceeb1f4d8">00078</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#a20fd0a52f211511f01c63f5ceeb1f4d8">regOrg</a>[3];
<a name="l00079"></a><a class="code" href="struct___machine_inst_format.html#a11c8b5b92fcf4edab64e39dc096a408f">00079</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#a11c8b5b92fcf4edab64e39dc096a408f">regDst</a>[3];
<a name="l00080"></a><a class="code" href="struct___machine_inst_format.html#ab59debee789b0be0ca71811fe2b5080f">00080</a>         <a class="code" href="union__mod__reg.html" title="Stores ModReg record attributes you set the registers used as operands.">MOD_REG_RM</a> <a class="code" href="struct___machine_inst_format.html#ab59debee789b0be0ca71811fe2b5080f">mod_reg_rm</a>;
<a name="l00081"></a>00081 
<a name="l00082"></a><a class="code" href="struct___machine_inst_format.html#a677fc789ef02b6679c3ed09d452b91b4">00082</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#a677fc789ef02b6679c3ed09d452b91b4" title="Operation Code Size.">opSize</a>[<a class="code" href="common_8h.html#a22613dfae1a9dc932b6a4513895411c9" title="supported number of operators">NUM_OPP_SUPPORTED</a>]; 
<a name="l00083"></a><a class="code" href="struct___machine_inst_format.html#a31057fc58f4b612b1619cbb4f3c4b979">00083</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#a31057fc58f4b612b1619cbb4f3c4b979" title="If it is an operation code valid.">opValid</a>[<a class="code" href="common_8h.html#a22613dfae1a9dc932b6a4513895411c9" title="supported number of operators">NUM_OPP_SUPPORTED</a>]; 
<a name="l00084"></a><a class="code" href="struct___machine_inst_format.html#a4eb58e92677c4abf81b67f89d36b3b3d">00084</a>         <a class="code" href="common_8h.html#ad8ce12d83f204245685f98caf9d03944" title="One byte.">UINT8</a> <a class="code" href="struct___machine_inst_format.html#a4eb58e92677c4abf81b67f89d36b3b3d" title="Operation Code.">op</a>[<a class="code" href="common_8h.html#a22613dfae1a9dc932b6a4513895411c9" title="supported number of operators">NUM_OPP_SUPPORTED</a>][128];
<a name="l00085"></a>00085 } <a class="code" href="common_8h.html#a66e747e261292e6aa8b1428bbc5957f7" title="Machine Instruction Format.">MACHINE_INSTRUCTION</a>;
<a name="l00089"></a><a class="code" href="struct_o_p_c_o_d_e___p_r_o_p_e_r_t_i_e_s.html">00089</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00090"></a>00090 {
<a name="l00091"></a><a class="code" href="struct_o_p_c_o_d_e___p_r_o_p_e_r_t_i_e_s.html#a9e072a07f80500964b1d604b5ee75862">00091</a>         <a class="code" href="common_8h.html#a7e125472d65b57f10905accbed140b99" title="Stores 8 bits.">INT8</a> mnemonic[10]; 
<a name="l00092"></a><a class="code" href="struct_o_p_c_o_d_e___p_r_o_p_e_r_t_i_e_s.html#a15d4fa32d95f297a491a56c9398b419d">00092</a>         <a class="code" href="struct__addresing_and_type.html" title="Stores the attributes that specifies the addressing method.">ADDRESSING_TYPE</a> operand_at[4];
<a name="l00093"></a>00093 } <a class="code" href="struct_o_p_c_o_d_e___p_r_o_p_e_r_t_i_e_s.html" title="Properties of an operation code..">OPCODE_PROPERTIES</a>;
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 <span class="preprocessor">#endif </span><span class="comment">/* COMMOND_H_ */</span>
</pre></div></div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="common_8h.html">common.h</a>      </li>

    <li class="footer">Generated on Thu Oct 11 2012 12:32:07 for Dissasemble by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
